<?PHP if(isset($_GET['uri'])) { 
$uri = ($_GET['uri']);
// Func
$length = strlen($uri);
if ($length != 6) {
die("PSL Live Cricket Coverage");
}
// Func ends


}
else {
echo "<meta name=\"ROBOTS\" content=\"INDEX, FOLLOW\" />
<title>!!! Access Denied !!!</title>";
echo "Please Do Not Try This !!! <br /> Play Fair";
exit();
}
//Cache Starts //
// include_once("cache.php");
//$cache = new Cache;
//$cache->start(); // Start caching (if needed)
// Cache starts end ?><html>
<head>
<link rel='stylesheet' href='http://csstvc.googlecode.com/svn/trunk/css/s.css' type='text/css' media='all' />

<?PHP
// Strip only one tag
function better_strip_tags($text, $tags = false, $replace = '') { 
    if ($tags === false) { 
        return strip_tags($text); 
    } 

    if (!is_array($tags)) { 
        $tags = array($tags); 
    } 

    foreach ($tags as $tag) { 
        $text = preg_replace("/<[\/\!]*?" . $tag . "[^<>]*?>/si", $replace, $text); 
    } 
     
    return $text; 
}  

// Strip tag end
//url
$url = 'http://www.espncricinfo.com/england-v-india-2011/engine/current/match/' . $uri . '.html?view=scorecard;wrappertype=live';

//get the page content
$imdb_content = get_data($url);

$imdb_content1 = str_replace('http://i.imgci.com/espncricinfo/col_ps.gif' , "http://csstvc.googlecode.com/svn/trunk/img/bullet.gif" , $imdb_content); // Conversion
$imdb_content = str_replace('class="inningsIcon" alt="View dismissal" title="View dismissal"' , '.' , $imdb_content1); // Conversion


//parse for product name
$teamText = get_match('/<p class="teamText">(.*)<\/p>/isU',$imdb_content);


$matchStatus = get_match('/<p class="statusText">(.*)<\/p>/isU',$imdb_content);

$bat1 = get_match('/<table class="inningsTable" id="inningsBat1">(.*)<\/table>/isU',$imdb_content);
$bowl1 = get_match('/<table id="inningsBowl1" class="inningsTable">(.*)<\/table>/isU',$imdb_content);
$fow = get_match('/<table class="inningsTable">(.*)<\/table>/isU',$imdb_content);


$bat2 = get_match('/<table class="inningsTable" id="inningsBat2">(.*)<\/table>/isU',$imdb_content);
$bowl2 = get_match('/<table id="inningsBowl2" class="inningsTable">(.*)<\/table>/isU',$imdb_content);

$bat3 = get_match('/<table class="inningsTable" id="inningsBat3">(.*)<\/table>/isU',$imdb_content);
$bowl3 = get_match('/<table id="inningsBowl3" class="inningsTable">(.*)<\/table>/isU',$imdb_content);

$bat4 = get_match('/<table class="inningsTable" id="inningsBat4">(.*)<\/table>/isU',$imdb_content);
$bowl4 = get_match('/<table id="inningsBowl4" class="inningsTable">(.*)<\/table>/isU',$imdb_content);

//$notes = get_match('/<table class="notesTable">(.*)<\/table>/isU',$imdb_content);



?>
<head>
<title><?PHP echo strip_tags($matchStatus[0]); ?></title>
<meta name="robots" content="index, follow" /> 
 <meta name="googlebot" content="index, follow" />
<meta http-equiv="refresh" content="30">
</head>

<body topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table2">

	<tr>

		<td>

		<img src="http://csstvc.googlecode.com/svn/trunk/img/lefttop.jpg" border="0" height="9" width="7"></td>

		<td background="http://csstvc.googlecode.com/svn/trunk/img/midtop.jpg" height="9" width="7">

		<img src="http://csstvc.googlecode.com/svn/trunk/img/midtop.jpg" border="0" height="9" width="7"></td>

		<td>

		<img src="http://csstvc.googlecode.com/svn/trunk/img/righttop.jpg" border="0" height="9" width="7"></td>



	</tr>

	<tr>

		<td background="http://csstvc.googlecode.com/svn/trunk/img/leftmid.jpg" height="9" width="7"></td>

		<td align="center" width="100%">


<?PHP
echo "<table><tr class=\"BoldI\">";
echo "<td>" . @strip_tags($teamText[0]) . "<br /><font color=\"blue\">" . @strip_tags($teamText[1]) ."</font><div style='float:right'><a onClick=\"window.location.reload()\" style=\"color:#000033; cursor: pointer\">Refresh</a></div></td></tr>";

echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: Maroon;\">" . @$matchStatus[0] ."</td></tr>";

?> <tr class="BoldI"><td class="TextC" style="color: Maroon;">
<script type="text/javascript"><!--
google_ad_client = "pub-6346843708666952";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2E0101";
google_color_text = "FFFFFF";
google_color_url = "666666";
google_ui_features = "rc:0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td></tr> <?PHP

echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bat1[0], 'a') ."</table></td>";
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bowl1[0], 'a') ."</table></td>";
// Fall of Wickets 
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($fow[0], 'a') ."</table></td>";
// FOW ends



echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bat2[0], 'a') ."</table></td>";
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bowl2[0], 'a') ."</table></td>";
// Fall of Wickets 
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($fow[1], 'a') ."</table></td>";
// FOW ends


echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bat3[0], 'a') ."</table></td>";
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bowl3[0], 'a') ."</table></td>";
// Fall of Wickets 
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($fow[2], 'a') ."</table></td>";
// FOW ends


echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bat4[0], 'a') ."</table></td>";
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($bowl4[0], 'a') ."</table></td>";
// Fall of Wickets 
echo "<tr class=\"BoldI\"><td class=\"TextC\" style=\"color: gray;\"><table>" . @better_strip_tags($fow[3], 'a') ."</table></td>";
// FOW ends

echo "</tr></table>";

?>
</td>

		<td background="http://csstvc.googlecode.com/svn/trunk/img/rightmid.jpg" height="9" width="7">&nbsp;

		</td>

	</tr>

	<tr>

		<td>

		<img src="http://csstvc.googlecode.com/svn/trunk/img/leftbot.jpg" border="0" height="9" width="7"></td>



		<td class="TextC" align="center" background="http://csstvc.googlecode.com/svn/trunk/img/midbot.jpg" height="100%" width="7"></td>

		<td>

		<img src="http://csstvc.googlecode.com/svn/trunk/img/rightbot.jpg" border="0" height="9" width="7"></td>

	</tr>

</table>



<?PHP



//gets the match content
function get_match($regex,$content)
{
	preg_match_all($regex,$content,$matches);
	return $matches[1];
}

//gets the data from a URL
function get_data($url)
{
	$ch = curl_init();
	$timeout = 5;
	curl_setopt($ch,CURLOPT_URL,$url);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
	$data = curl_exec($ch);
	curl_close($ch);
	return $data;
}

?>
</body>
<?PHP
///////////////////////////// CACHE //////////////////////
//	$cache->end(); // Stop caching ?>